package com.fanrenqiji.modules.sys.entity;

import com.fanrenqiji.common.persistence.DataEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * @author lijian E-mail:ljz0721cx@163.com
 * @version 创建时间：2015年1月22日 上午11:36:06
 * @description 数据字典表实体
 */
@Entity
@Table(name = "sys_dict")
@DynamicInsert
@DynamicUpdate
public class Dict extends DataEntity {

	private static final long serialVersionUID = 1L;

	/**
	 * 编号
	 */
	private Long id;
	/**
	 * 标签名
	 */
	private String label;
	/**
	 * 数据值
	 */
	private String value;
	/**
	 * 类型
	 */
	private String type;
	/**
	 * 描述
	 */
	private String description;
	/**
	 * 排序
	 */
	private Integer sort;

	public Dict() {
		super();
	}

	public Dict(Long id) {
		this();
		this.id = id;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Length(min = 1, max = 100)
	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	@Length(min = 1, max = 100)
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	@Length(min = 1, max = 100)
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Length(min = 0, max = 100)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@NotNull
	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

}
